package com.example.shopping.entity.dto;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;



@Data
public class OrderDTO  {
    private int oid;
    private int uid;
    private String gid;
    private int quantity;
    private double money;
    private LocalDateTime buytime;
    private String rphone;
    private String mailingaddress;
    private LocalDateTime backtime;
    private String status;
    private String receiver ;


    private String username;
    private String goodsname;
    private float price;
    private int pageno;


    private LocalDate buytimebegin;
    private LocalDate buytimeend;



    // 构造函数
    public OrderDTO(Integer oid, String username, String goodsname, String mailingaddress, String rphone, Integer quantity, Double money, LocalDateTime buytime) {
        this.oid = oid;
        this.username = username;
        this.goodsname = goodsname;
        this.mailingaddress = mailingaddress;
        this.rphone = rphone;
        this.quantity = quantity;
        this.money = money;
        this.buytime = buytime;
    }

    // 构造函数必须与 JPQL 查询字段顺序一致
    public OrderDTO(int oid, String username, String goodsname,
                    String mailingaddress, String rphone, String receiver,
                    LocalDateTime buytime, int quantity, double money) {
        this.oid = oid;
        this.username = username;
        this.goodsname = goodsname;
        this.mailingaddress = mailingaddress;
        this.rphone = rphone;
        this.receiver = receiver;
        this.buytime = buytime;
        this.quantity = quantity;
        this.money = money;
    }

    public OrderDTO() {

    }
}
